﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Internal.Master" Inherits="BPM.Web.ViewPage<MaterialDefinition>" %>

<%@ Import Namespace="BPM" %>
<%@ Import Namespace="BPM.Entity" %>
<asp:Content ID="c1" ContentPlaceHolderID="TitleContent" runat="server">
	添加物料
</asp:Content>
<asp:Content ID="c3" ContentPlaceHolderID="ScriptStyleContent" runat="server">
	<%
		var error = this.ViewData["Error"] as string;
		var bigCatesJson = this.ViewData["AllBigCates"] as string;
	%>
	<script type="text/javascript">
	bigCates = <%=bigCatesJson %>;
	error = '<%:error %>';
	</script>
</asp:Content>
<asp:Content ID="c2" ContentPlaceHolderID="MainContent" runat="server">
	<%
		var deliveryList = new MultiSelectList(new string[] { "日", "周", "月", "年" });
		var vm = this.ViewData["PreviousData"] as BPM.ViewModel.AddMaterialViewModel;
	%>
	<div style="margin-left: 30px;">
		<% using (Html.BeginForm(
		AD.Singleton.MaterialManagement.AddMaterial,
		AD.Singleton.MaterialManagement.ToString(),
		FormMethod.Post,
		new { enctype = "multipart/form-data" }
		 ))
	 {%>
		<table id="tableAddMaterial" class="inputTable">
			<tbody>
				<tr id="trCode" style="height: 30px;">
					<th>
						识别条码
					</th>
					<td style="vertical-align: top;">
						<%: Html.TextBox("BarcodeNumber", Html.ifnotnull(vm, e => e.BarcodeNumber)) %>
					</td>
				</tr>
				<tr>
					<th>
						物料名称
					</th>
					<td>
						<%: Html.TextBoxFor(m => m.Name)%>
						<span class="requiredTag">*</span>
					</td>
				</tr>
				<tr>
					<th>
						所属大类
					</th>
					<td>
						<select name="BigCategoryId" id="BigCategoryId">
							<option selected="selected">框架</option>
							<option>内部部件</option>
							<option>外部部件</option>
						</select>&nbsp;<span class="requiredTag">*</span>
					</td>
				</tr>
				<tr>
					<th>
						所属小类
					</th>
					<td>
						<select name="CategoryId" id="CategoryId">
							<option>铜片</option>
							<option>银丝</option>
							<option>夜光漆</option>
						</select>&nbsp;<span class="requiredTag">*</span>
					</td>
				</tr>
				<tr>
					<th>
						品牌
					</th>
					<td>
						<%: Html.TextBoxFor(m => m.Brand)%>
					</td>
				</tr>
				<tr>
					<th>
						价格（元）
					</th>
					<td>
						<%: Html.TextBoxFor(m => m.Price)%>
					</td>
				</tr>
				<tr>
					<th>
						供应商名称
					</th>
					<td>
						<%: Html.TextBoxFor(m => m.SupplierName)%>
					</td>
				</tr>
				<tr>
					<th>
						联系人
					</th>
					<td>
						<%: Html.TextBoxFor(m => m.ContactName)%>
					</td>
				</tr>
				<tr>
					<th>
						联系电话
					</th>
					<td>
						<%: Html.TextBoxFor(m => m.ContactPhone)%>
					</td>
				</tr>
				<tr>
					<th>
						其他联系方式
					</th>
					<td>
						<%: Html.TextBoxFor(m => m.OtherContact)%>
					</td>
				</tr>
				<tr>
					<th>
						供货周期
					</th>
					<td>
						<%: Html.TextBoxFor(m => m.DeliveryPeriod, new { size = "5" })%>
						<%: Html.DropDownListFor(m => m.DeliverPeriodUnit, deliveryList, new { style = "width: 100px;" })%>
					</td>
				</tr>
				<tr>
					<th>
						付款方式
					</th>
					<td>
						<%: Html.TextBoxFor(m => m.PaymentMode)%>
					</td>
				</tr>
				<tr>
					<th>
						备注
					</th>
					<td>
						<%: Html.TextAreaFor(m => m.Remark, 5, 25, null)%>
					</td>
				</tr>
				<tr>
					<th>
						物料图片
					</th>
					<td>
						<input name="ImagePath" type="file" />
					</td>
				</tr>
				<tr>
					<th>
						用户条码验证:
					</th>
					<td>
						<%:Html.TextBox("UserCodeValidate", Html.ifnotnull(vm, e => e.UserCodeValidate))%>
						<span class="requiredTag">*</span>
					</td>
				</tr>
				<tr>
					<th>
					</th>
					<td>
						<input type="submit" value="添加" />
						<input type="button" value="查看所有" onclick="returnBack();" />
					</td>
				</tr>
			</tbody>
		</table>
		<%} %>
	</div>
</asp:Content>
